<?php

namespace app\admin\traits;

trait CheckCompany
{

    /**
     * 检查企业是否存在
     *
     * @param int $company_id
     * @return bool
     */
    protected function __checkCompanyExist__()
    {
        $company_id = getSelectedCompany();
        if (is_null($company_id)) {
            throw new \think\Exception('请先选择企业');
        }
        return true;
    }

}